﻿#ifndef BUBBLE_H
#define BUBBLE_H

#include <QWidget>

namespace Ui {
class Bubble;
}

class Bubble : public QWidget
{
    Q_OBJECT

public:
    explicit Bubble(QWidget *parent = nullptr);
    ~Bubble();


    void setContent(int avatar, const QString& text, const QString & time, int width);

    void setPicture(int avatar, const QString& picPath, const QString& time, int width);

    QSize sizeHint() const override;


private:
    int computeHeight(int width) const;

    Ui::Bubble *ui;
    bool is_text;
    QPixmap pic;
};

#endif // BUBBLE_H
